<?php

namespace app\model\frontend;
use think\Model;
class BannerModel extends Model{


    public static function findByName( $name ){
        // global $_W;
        $uniacid = $_GET['i'];
        $sql = "select * from sh_banner where `status`='1' "
            . " and `name` ='" . $name . "'"
            . " and `uniacid` ='" . $uniacid . "'";

        $result = pdo_fetch( $sql );
        return !empty( $result ) ? $result : false;
    }

    public static function findImageById( $banner_id ){
        $sql = "select * from sh_banner_image where banner_id ='" . $banner_id . "' order by sort_order";


        $result = pdo_fetchall( $sql );
        return $result;
    }

}